﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:CounterStrikeSourceAimbot_WpfControls"
	mc:Ignorable="d"
	x:Class="CounterStrikeSourceAimbot_WpfControls.PersonSymbol"
	x:Name="UserControl" Height="40" Width="40" DataContext="{Binding Context, ElementName=UserControl}" RenderTransformOrigin="0.5,0.5" >

    <UserControl.Resources>
        <local:ParametricVisibilityConverter x:Key="ParametricVisibilityConverter"/>
        <local:OprativeNumberConverter x:Key="OprativeNumberConverter"/>
        <local:PlayerColorConverter x:Key="PlayerColorConverter"/>
        <local:PlayerScaleConverter x:Key="PlayerScaleConverter"/>
    </UserControl.Resources>


    <Grid x:Name="LayoutRoot"  Margin="-10,-10,10,10">
        <Grid.RenderTransform>
            <TransformGroup>
                <ScaleTransform ScaleX="{Binding Scale, FallbackValue=1.0}" ScaleY="{Binding Scale, FallbackValue=1.0}"/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </Grid.RenderTransform>

        <Grid x:Name="AliveStuff" RenderTransformOrigin="0.5,0.5" Margin="0,0.062,-4.584,-0.062" Visibility="{Binding IsDead, ConverterParameter=False, Converter={StaticResource ParametricVisibilityConverter}, FallbackValue = true}" d:IsHidden="True">
            <Grid.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform Angle="{Binding Yaw, ConverterParameter=-1, Converter={StaticResource OprativeNumberConverter}}"/>
                    <TranslateTransform/>
                </TransformGroup>
            </Grid.RenderTransform>

            <Ellipse Fill="{Binding Team, Converter={StaticResource PlayerColorConverter}, FallbackValue=Green}" Stroke="Black" StrokeThickness="0" Margin="0,0,4.584,0"/>
            <Ellipse Fill="Yellow" Stroke="Black" StrokeThickness="0" Margin="0,0,4.584,0" Visibility="{Binding IsFocused, ConverterParameter=true, Converter={StaticResource ParametricVisibilityConverter}, FallbackValue = true}" />
            
            <TextBlock Margin="5,05,0,0" FontSize="20" Text="{Binding Health}" Foreground="White"></TextBlock>

            <Path Data="M13.166667,2.5833291 C17.538606,7.2088035 17.539124,7.8755385 13.208,12.333329 13.208,7.3755033 13.166667,2.5833291 13.166667,2.5833291 z" Fill="#FFF4F4F5" Margin="0,2.511,0,2.489" Stretch="Fill" Stroke="Black" StrokeThickness="0" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" Width="8.078"/>
            
            
        </Grid>
        
        

        <Grid x:Name="DeadStuff" Margin="2" Visibility="{Binding IsDead, ConverterParameter=True, Converter={StaticResource ParametricVisibilityConverter}}" RenderTransformOrigin="0.5,0.5">
           
            <Path Stroke="{Binding Team, Converter={StaticResource PlayerColorConverter}, FallbackValue=Green}" Data="M1.5,2.511 L16.506,17.511" Fill="#FFF4F4F5" Stretch="Fill" StrokeThickness="4" Opacity="0.5"/>
            <Path Stroke="{Binding Team, Converter={StaticResource PlayerColorConverter}, FallbackValue=Green}" Data="M1.5,17.511 L16.506,2.511" Fill="#FFF4F4F5" Stretch="Fill" StrokeThickness="4" Opacity="0.5"/>
        </Grid>
    </Grid>
</UserControl>